/**
@author Jiange
@create 2022-06-07-11:41
 */

fun main() {
    println(LOL() as? String)
    println("jian".jian)
    println(null.jian2())
    mapOf(Pair("name", "lzj"), Pair("age", 18), "sex" to "男")
}

infix fun <T, R> T.jianjian(that: R):Pair<T, R> = Pair(this, that)

inline fun <A, B> A.jiange(that: B): Pair<A, B> = Pair(this, that)

private val String.jian: Int
    get() = this.length

fun String?.jian2() :String? {
    return this
}

fun <T> T.jian1() = println("Shuchu$this")

fun Any.jian() = println("输出$this")

fun lai(name: String): String{
    require(!name.isNullOrBlank()){"要求不为空"}
    return "jian"
}

abstract class UUU {
    abstract var age: Int
    abstract fun show(name: String)
}

interface Jian1 {
    var age: Int
}



class LOL : UUU() {
    override var age: Int = 0
        get() = (0..11).shuffled().last()
        set(value) {
            field = value
        }

    override fun show(name: String) {

    }

    fun <T> jian(name: T) {

    }
}

sealed class UU {
    object OP: UU()
    object Ji: UU()
    object Ll: UU()
    class K1(var name: String)
}


class PP (var name: String) {

    lateinit var a: String

//    lateinit var pass: String

//    fun showPass() {
//        if (::pass.isInitialized)
//    }

    val pass: String by lazy { getMyPass() }

    fun getMyPass():String {
        return "jian"
    }

    var age: Int = 0
    constructor(name: String, age: Int) : this(name) {
        this.age = age
    }
}

enum class OO {
    WEEK,
    DAY;
}

data class Jian2(val name: String)
data class Jian4(val name: String)
data class Jian5(val name: String)

class Jian3 <T> {

    fun randomOrDefault() =
        listOf(Jian2("jian"), Jian4("ge"), Jian5("lai"))


    val randomObj = randomOrDefault().shuffled().first()
}
